package com.cy.ppj.service.message.impl;

import com.cy.ppj.dao.mapper.message.MessageTemplateMapper;
import com.cy.ppj.model.domian.message.MessageTemplate;
import com.cy.ppj.model.enums.MessageType;
import com.cy.ppj.service.BaseService;
import com.cy.ppj.service.message.MessageTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description: 消息模版
 * @author: Ocean
 * @create: 2018-09-14 11:13
 **/
@Slf4j
@Service
public class MessageTemplateServiceImpl extends BaseService implements MessageTemplateService {

    @Autowired
    private MessageTemplateMapper messageTemplateMapper;

    @Override
    public MessageTemplate queryMessageTemplateByTypeInCache(MessageType type) {

        MessageTemplate messageTemplate = new MessageTemplate();
        messageTemplate.setType(type);

        return messageTemplateMapper.selectOne(messageTemplate);
    }
}
